import { Descriptions } from 'antd'
import { useRecoilValue } from 'recoil'
import style from './style.module.less'
import IconSvg from '@/components/IconSvg'
import { adminEnum } from '@/store/adminEnumObject'

import { userInfo } from '@/store/userInfo'

export default () => {
  // 用户信息
  const user = useRecoilValue(userInfo)
  // 用户角色枚举
  const adminEnumValues: any = useRecoilValue(adminEnum)

  return (
    <div className={style.maxBox}>
      <div className={style.examineBox}>
        <div className={style.center}>
          <div className={style.top}>病区管理员信息</div>
          <div className={style.bottom}>
            <div className={style.bottomCenter}>
              <Descriptions column={1} bordered={false} className={style.description}>
                <Descriptions.Item label='用户角色'>{adminEnumValues[user.accountType]}</Descriptions.Item>
                <Descriptions.Item label='姓名'>{user.username}</Descriptions.Item>
                <Descriptions.Item label='绑定邮箱'>{user.email}</Descriptions.Item>
                <Descriptions.Item label='联系电话'>{user.phone}</Descriptions.Item>
                <Descriptions.Item label='账号密码'>******</Descriptions.Item>
                <Descriptions.Item label='登录次数'>{user.loginTimes}</Descriptions.Item>
                <Descriptions.Item label='上一次登录时间'>{user.lastLoginDate}</Descriptions.Item>
              </Descriptions>
            </div>
          </div>
          <div className={style.imageBox}>
            <IconSvg name='examineImage' style={{ width: '100%', height: '100%' }} />
          </div>
        </div>
      </div>
    </div>
  )
}
